<!DOCTYPE html>
<html>
<head>
<title>ChinaZ</title>
<link href="../static/css/style.css" rel='stylesheet' type='text/css' />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="App Loction Form,Login Forms,Sign up Forms,Registration Forms,News latter Forms,Elements"./>
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
</script>
<!--webfonts-->
<link href='http://fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<!--//webfonts-->
</head>
<body>
	<h1>App Location Form</h1>
		<div class="app-location">
			<h2>Welcome to Locaticus</h2>
			<div class="line"><span></span></div>
			<div class="location"><img src="../static/images/location.png" class="img-responsive" alt="" /></div>
			<form>
				<input type="text" id=usernameId  name="username" class="text" value="用户名" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = '用户名';}" >
				<input type="password"  id=passwordId name="password" value="密码" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = '密码';}">
				<div class="submit"><input type="submit" onclick="doLogin()" value="登录" ></div>
				<div class="clear"></div>
				<div class="new">
					<h3><a href="#">Forgot password ?</a></h3>
					<h4><a href="#">New here ? Sign Up</a></h4>
					<div class="clear"></div>
				</div>
			</form>
		</div>

<script>
        function doLogin() {
            var params = {
                username: $("#usernameId").val(),
                password: $("#passwordId").val(),
            }
            var url = "user/doLogin";
            console.log("params", params);
            $.post(url, params, function (result) {
                if (result.status == 200) {
                    //跳转到indexUI对应的页面
                    location.href = "doIndexUI?t=" + Math.random();
                } else {
                    $(".login-box-msg").html(result.msg);
                }
                return false;//防止刷新时重复提交
            });
        }

</script>
</body>
</html>